package xyz.lwm.lazycat.utility;

/**
 * 三元
 *
 * @author lwm
 * @param <L>
 * @param <M>
 * @param <R>
 */
public interface Trio<L, M, R> {

    L getLeft();

    M getMiddle();

    R getRight();

    static <L, M, R> Trio<L, M, R> of(L left, M middle, R right) {
        return new Trio<L, M, R>() {
            @Override
            public L getLeft() {
                return left;
            }

            @Override
            public M getMiddle() {
                return middle;
            }

            @Override
            public R getRight() {
                return right;
            }

            @Override
            public String toString() {
                return "l: " + left + ", m: " + middle + ", r: " + right;
            }
        };
    }

}
